package com.xr.el.entity;

import com.xr.el.annotation.DocId;
import com.xr.el.annotation.EsClass;
import com.xr.el.annotation.EsField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

// 只能使用包装类型 ,不能使用基础类型 ,否则会导致一些高级特性有问题
@EsClass
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserEsEntity
{
    @DocId
    private Long id;

    @EsField(name = "userName",type = EsDataType.KEYWORD )
    private String name;

    @EsField(type = EsDataType.INTEGER)
    private Integer age;

    @EsField(type = EsDataType.TEXT,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String dec;

    @EsField(type = EsDataType.KEYWORD)
    private String sku;

    @EsField(type = EsDataType.DOUBLE)
    private Double price;
}

